<style scoped >
    .ddtzMessage .ivu-input-wrapper {  width: 90%;  }
    .ddtzMessage .ivu-select  {  width: 90%;  }
    .textarea .ivu-input-wrapper{  width:96%;  }
    .ysjq  .ivu-input-wrapper {  width: 90%; }
    .clbm  .ivu-input-wrapper {  width: 90%;  }
    .ddtzMessage .ivu-date-picker{width: 90%;display: inline-block;}
    .footer .ivu-btn{
        padding: 6px 23px;
        font-size: 12px;
        border-radius: 3px;
        background: #2db3b4;
        color: #fff;
        border: 0;
    }
    .footer .ivu-btn:hover{background: #019ea3;}
    .ddtzbody .ivu-row{padding: 3px 16px;box-shadow: 0px 0px 3px 0px #f0f0f0;}
    .ddtzbody .center .ivu-row .ivu-col .ivu-form-item{margin-bottom: 0px;}
</style>
<template>
    <div class="console-product">
        <!-- 头部-->
        <Row class="position">
            <i-col :xs="12" :sm="10" :md="8" :lg="6" >
                <div class="ivu-breadcrumb pos">
                    <span class="ivu-breadcrumb-item-link">当前位置：</span>
                    <span class="ivu-breadcrumb-item-link">业务中心</span>
                    <span class="ivu-breadcrumb-item-separator">/</span>
                    <span class="ivu-breadcrumb-item-link">订单停滞</span>
                </div>
            </i-col>
            <i-col class="fr">
                <span>
                    <Button @click="addMessage"><i class="iconfont" style="color:#37b3b3;">&#xe70d;</i> 发送消息</Button>
                    <Modal  class-name="popup"class="ddtzMessage" v-model="messageModal" @on-cancel="clearPicOrder('ddtzValidate')" width="600" :mask-closable="false">
                    <p slot="header"style="color: #eeebeb;"  v-drag>
                        <span>发送消息</span>
                    </p>
                    <div class="center">
                        <Form  ref="ddtzValidate" :rules="ruleDdtz"  :model="ddtzValidate"  label-position="left" :label-width="65">
                            <Row>
                                <i-col span="12">
                                    <Form-item label="类型:" prop="czlx">
                                        <Radio-group v-model="ddtzValidate.czlx" @on-change="changeczlx">
                                            <Radio label="1">停滞</Radio>
                                            <Radio label="2">放行</Radio>
                                            <Radio label="3">换料</Radio>
                                        </Radio-group>
                                    </Form-item>
                                </i-col>
                                <i-col span="12">
                                    <Form-item label="料状态:" prop="isproduce">
                                        <Radio-group v-model="ddtzValidate.isproduce">
                                            <Radio label="未裁料">未裁</Radio>
                                            <Radio label="已裁料">已裁</Radio>
                                        </Radio-group>
                                    </Form-item>
                                </i-col>
                            </Row>
                            <Row>
                                <i-col span="12">
                                    <Form-item label="订单号:" class="ordernum" prop="khdh">
                                        <Select class="order" @on-change="changeOrder" v-model="ddtzValidate.khdh" filterable remote :remote-method="remoteOrderno" clearable :loading="loadingOrderno">
                                            <Option v-for="item in autoList" :value="item.khdh" :key="item">{{ item.khdh }}</Option>
                                        </Select>
                                    </Form-item>
                                </i-col>
                                <i-col span="12">
                                    <Form-item label="系统号:" prop="syscode">
                                        <Input v-model="ddtzValidate.syscode"  disabled></Input>
                                    </Form-item>
                                </i-col>
                            </Row>
                            <Row v-show="isFXHL">
                                <i-col span="12">
                                    <Form-item class="ysjq" label="原交期:" prop="jhrq">
                                        <Input v-model="ddtzValidate.jhrq"  disabled></Input>
                                    </Form-item>
                                </i-col>
                                <i-col span="12">
                                    <Form-item label="新交期:" prop="chpjq">
                                        <Date-picker type="date" v-model="ddtzValidate.chpjq" ></Date-picker>
                                    </Form-item>
                                </i-col>
                            </Row>
                            <Row v-show="isFX">
                                <i-col span="12">
                                    <Form-item label="裁剪交期:" prop="cjjq">
                                        <Date-picker type="datetime" v-model="ddtzValidate.cjjq" ></Date-picker>
                                    </Form-item>
                                </i-col>
                                <i-col span="12">
                                    <Form-item label="缝制交期:" prop="fzhjq">
                                        <Date-picker type="datetime" v-model="ddtzValidate.fzhjq" ></Date-picker>
                                    </Form-item>
                                </i-col>
                            </Row>
                            <Row v-show="isFX">
                                <i-col span="12">
                                    <Form-item label="整烫交期:" prop="zhtjq">
                                        <Date-picker type="datetime" v-model="ddtzValidate.zhtjq" ></Date-picker>
                                    </Form-item>
                                </i-col>
                                <i-col span="12">
                                    <Form-item label="包装交期:" prop="bzhjq">
                                        <Date-picker type="datetime" v-model="ddtzValidate.bzhjq" ></Date-picker>
                                    </Form-item>
                                </i-col>
                            </Row>
                            <Row v-show="isTZHL">
                                <i-col span="12">
                                    <Form-item label="料类型:" prop="cllx">
                                        <Select v-model="ddtzValidate.cllx" @on-change="changeCllx">
                                            <Option v-for="item in ddtzcllxList" :value="item.cYlbwflEcode" :key="item">{{ item.cYlbwflEname }}</Option>
                                        </Select>
                                    </Form-item>
                                </i-col>
                                <i-col span="12">
                                    <Form-item class="clbm" label="料编码:" prop="clbm">
                                        <Select v-model="ddtzValidate.clbm" disabled v-show="isTZ">
                                            <Option v-for="item in ddtzclbmList" :value="item.cYlbwflEcode" :key="item">{{ item.tDdpbylmxYlbm }}</Option>
                                        </Select>
                                        <Input v-model="ddtzValidate.clbm" v-show="isHL"></Input>
                                    </Form-item>
                                </i-col>
                            </Row>
                            <Row v-show="isTZ" class="danwei">
                                <i-col span="12">
                                    <Form-item label="大块料:" prop="dklclcd">
                                        <i-input v-model="ddtzValidate.dklclcd">
                                        <span slot="append">(m)</span>
                                        </i-input>
                                    </Form-item>
                                </i-col>
                                <i-col span="12">
                                    <Form-item label="小块料:" prop="xklclcd">
                                        <i-input v-model="ddtzValidate.xklclcd">
                                        <span slot="append">(m)</span>
                                        </i-input>
                                    </Form-item>
                                </i-col>
                            </Row>
                            <Row>
                                <i-col class="textarea" span="24">
                                    <Form-item label="备注:" prop="desc">
                                        <Input v-model="ddtzValidate.desc" type="textarea" :rows="1"></Input>
                                    </Form-item>
                                </i-col>
                            </Row>
                        </Form>
                    </div>
                    <div slot="footer">
                        <div class="footer">
                            <Button v-if="isSend" type="error" size="small" :loading="modal_loading" @click="sendPicOrder('ddtzValidate')">发送</Button>
                        </div>
                    </div>
                </Modal>
                </span>
                <Modal  class-name="popup"class="ddtzbody" v-model="ddtzModal" width="600" @on-cancel="cancel" :mask-closable="false">
                    <p slot="header"  v-drag>
                        <span style="color:#fff" >订单停滞详情</span>
                    </p>
                    <div class="center">
                        <Form  ref="ddtzDetail"  :model="ddtzDetail"  label-position="left" :label-width="80">
                            <Row style="padding-top: 8px">
                                <input type="hidden" name="id" v-model="ddtzDetail.id">
                                <i-col span="12">
                                    <Form-item label="操作类型:" prop="czlx">
                                        <span>{{ddtzDetail.czlx}}</span>
                                    </Form-item>
                                </i-col>
                                <i-col span="12">
                                    <Form-item label="料类型:" prop="cllx">
                                        <span>{{ddtzDetail.cllx}}</span>
                                    </Form-item>
                                </i-col>
                            </Row>
                            <Row>
                                <i-col span="12">
                                    <Form-item label="类型:" prop="isproduce">
                                        <span>{{ddtzDetail.isproduce}}</span>
                                    </Form-item>
                                </i-col>
                                <i-col span="12">
                                    <Form-item label="创建人:" prop="createby">
                                        <span>{{ddtzDetail.createby}}</span>
                                    </Form-item>
                                </i-col>
                            </Row>
                            <Row>
                                <i-col span="12">
                                    <Form-item label="订单号:" prop="khdh">
                                        <span>{{ddtzDetail.khdh}}</span>
                                    </Form-item>
                                </i-col>
                                <i-col span="12">
                                    <Form-item label="结果代码:" prop="resultcode">
                                        <span>{{ddtzDetail.resultcode}}</span>
                                    </Form-item>
                                </i-col>
                            </Row>
                            <Row>
                                <i-col span="12">
                                    <Form-item label="系统号:" prop="syscode">
                                        <span>{{ddtzDetail.syscode}}</span>
                                    </Form-item>
                                </i-col>
                                <i-col span="12">
                                    <Form-item label="操作日期:" prop="czrq">
                                        <span>{{ddtzDetail.czrq}}</span>
                                    </Form-item>
                                </i-col>
                            </Row>
                            <Row>
                                <i-col span="12">
                                    <Form-item label="料编码:" prop="clbm">
                                        <span>{{ddtzDetail.clbm}}</span>
                                    </Form-item>
                                </i-col>
                                <i-col span="12">
                                    <Form-item label="IP:" prop="ip">
                                        <span>{{ddtzDetail.ip}}</span>
                                    </Form-item>
                                </i-col>
                            </Row>
                            <Row>
                                <i-col span="12">
                                    <Form-item label="大块料:" prop="dklclcd">
                                        <span>{{ddtzDetail.dklclcd}}</span>
                                    </Form-item>
                                </i-col>
                                <i-col span="12">
                                    <Form-item label="用户名:" prop="username">
                                        <span>{{ddtzDetail.tranmeomo}}</span>
                                    </Form-item>
                                </i-col>
                            </Row>
                            <Row style="padding-bottom: 8px">
                                <i-col span="12">
                                    <Form-item label="小块料:" prop="xklclcd">
                                        <span>{{ddtzDetail.xklclcd}}</span>
                                    </Form-item>
                                </i-col>
                                <i-col span="12">
                                    <Form-item label="备注:" prop="tranmeomo">
                                        <span>{{ddtzDetail.username}}</span>
                                    </Form-item>
                                </i-col>
                            </Row>
                        </Form>
                    </div>
                    <div slot="footer"></div>
                </Modal>
            </i-col>
        </Row>
        <Modal v-model="delModal" class-name="delect" width="250" :loading="delLoading" @on-cancel="delCancel" :mask-closable="false">
            <p slot="header" style="color: #eeebeb"  v-drag>
                <span>提示框</span>
            </p>
            <p class="delbody">
                <i class="iconfont" style="color: #f76165;font-size: 16px;">&#xe615</i>&nbsp;&nbsp;确认撤销？
                </p>
            <div slot="footer">
                <div class="footer">
                    <Button  class="save" :loading="delLoading" @click="delOK">确认</Button>
                    <Button class="clear" @click="delCancel">取消</Button>
                </div>
            </div>
        </Modal>
        <!-- 头部结束-->
        <!-- 中间主体-->
        <div class="console-product-contcent" id="contcentHeight" :style="{height:height +'px'}">
            <!-- 搜索-->
            <Form class="searchform" ref="ddtzForm" :model="ddtzForm" inline  >
                <Form-item label="订单:" :label-width="35" style="width:160px;">
                    <Input v-model="ddtzForm.khdh" placeholder="" @on-enter="ddtzFormSearch"></Input>
                </Form-item>
                <Form-item label="日期:" :label-width="35" style="width:235px;">
                    <Date-picker type="daterange" v-model="ddtzForm.creatDate" :options="creatDate0ptions" placement="bottom-start" style="width: 200px"></Date-picker>
                </Form-item>
                <Form-item label="操作类型:" :label-width="65" style="width: 160px">
                    <Select v-model="ddtzForm.czlx">
                        <Option v-for="item in ddtztypeList" :value="item.value" :key="item">{{ item.label }}</Option>
                    </Select>
                </Form-item>
                <Form-item>
                    <Button class="search" @click="ddtzFormSearch">搜索</Button>
                </Form-item>
            </Form>
            <!-- 搜索结束-->
            <!-- 表格-->
            <Loading v-if="spinShow"></Loading>
            <Table v-if="tableShow"  stripe border :columns="ddtzColumns" :data="ddtzData"></Table>
        </div>
        <Row style="background-color: #ffffff;margin-top: 1px;">
            <Col>
            <div v-if="tableShow" class="tablepage clearfix">
                <div class="fl">
                    <span>共</span>
                    <span class="num">{{total}}</span>
                    <span>条记录</span>
                    <span>{{currentPage}}/{{pageTotal}}页</span>
                </div>
                <div class="fr">
                    <Page :total="total" :page-size="pageSize" :current="currentPage" placement="top" show-elevator show-sizer @on-change="changePage" @on-page-size-change="changeSize"></Page>
                </div>
            </div>
            </Col>
        </Row>
    </div>
</template>
<script>
    import Loading from '../../components/loading';
    export default {
        //所需子组件
        components: {Loading},
        data () {
            return {
                total:0,//总条数
                currentPage:1,//当前页
                pageTotal:1,//总页数
                pageSize:10,//默认每页显示数量
                height:1000,//表单高度
                spinShow: true,//加载层，默认显示
                tableShow: false,//表格层，默认隐藏
                modal_loading: false,
                ddtzModal:false,
                isSend:false,
                messageModal:false,
                footer:false,
                isTZ:true,
                isTZHL:true,
                isHL:false,
                isFXHL:false,
                isFX:false,
                delModal:false,
                delLoading:false,//删除
                autoList:[],
                loadingOrderno:false,
                delId:'',//删除id
                ddtzForm:{//客户档案条件查询
                    khdh:"",     //订单
                    creatDate:[new Date().getTime() - 3600 * 1000 * 24 * 7,new Date()],
                    czlx:'停滞'   //操作类型
                },
                //操作状态列表
                ddtztypeList: [
                    {
                        value: '停滞',
                        label: '停滞'
                    },
                    {
                        value: '放行',
                        label: '放行'
                    },
                    {
                        value: '换料',
                        label: '换料'
                    }
                ],
                //验证
                //料类型
                ddtzcllxList:[],
                //料编码
                ddtzclbmList:[],
                ruleDdtz: {
                    khdh: [
                        { required: true, message: '请输入订单号', trigger: 'blur' }
                    ],
                },
                //详情数据格式
                ddtzDetail:{
                    clbm:"",
                    cllx:"",
                    cnbltype:"",
                    columns:"",
                    createby:"",
                    czlx:"",
                    czrq:"",
                    dklclcd:"",
                    id:"",
                    ip:"",
                    iscancel:"",
                    isproduce:"",
                    khdh:"",
                    orderby:"",
                    resultcode:"",
                    syscode:"",
                    tranmeomo:"",
                    username:"",
                    xklclcd:""
                },
                ddtzValidate:{
                    id:"",
                    dklclcd:'',
                    xklclcd:'',
                    cllx:'',
                    isproduce:'未裁料',
                    tranmeomo:'',
                    khdh:'',
                    resultcode:'',
                    syscode:'',
                    czrq:'',
                    clbm:'',
                    czlx:'1',
                    jhrq:'',
                    chpjq:'',
                    cjjq:'',
                    fzhjq:'',
                    zhtjq:'',
                    bzhjq:''
                },
                creatDate0ptions: {
                    shortcuts: [
                        {
                            text: '最近一周',
                            value () {
                                const end = new Date();
                                const start = new Date();
                                start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                                return [start, end];
                            }
                        },
                        {
                            text: '最近一个月',
                            value () {
                                const end = new Date();
                                const start = new Date();
                                start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                                return [start, end];
                            }
                        },
                        {
                            text: '最近三个月',
                            value () {
                                const end = new Date();
                                const start = new Date();
                                start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                                return [start, end];
                            }
                        }
                    ]
                },
                //订单停滞数据格式
                ddtzColumns:[
                    {
                        width:'12%',
                        title: '订单号',
                        key: 'khdh',
                        render: (h, params) => {
                            return h('Tooltip', {
                                props: {
                                    content: params.row.khdh,
                                    placement:"bottom-start"
                                }
                            }, [h('span', params.row.khdh)]);
                        }

                    },
                    {
                        width:'10%',
                        title: '料类型',
                        key: 'cllx',
                        render: (h, params) => {
                            return h('Tooltip', {
                                props: {
                                    content: params.row.cllx,
                                    placement:"bottom-start"
                                }
                            }, [h('span', params.row.cllx)]);
                        }
                    },
                    {
                        width:'12%',
                        title: '料编码',
                        key: 'clbm',
                        render: (h, params) => {
                            return h('Tooltip', {
                                props: {
                                    content: params.row.clbm,
                                    placement:"bottom-start"
                                }
                            }, [h('span', params.row.clbm)]);
                        }
                    },
                    {
                        width:'9%',
                        title: '大块料',
                        key: 'dklclcd',
                        render: (h, params) => {
                            return h('Tooltip', {
                                props: {
                                    content: params.row.dklclcd,
                                    placement:"bottom-start"
                                }
                            }, [h('span', params.row.dklclcd)]);
                        }
                    },
                    {
                        width:'9%',
                        title: '小块料',
                        key: 'xklclcd',
                        render: (h, params) => {
                            return h('Tooltip', {
                                props: {
                                    content: params.row.xklclcd,
                                    placement:"bottom-start"
                                }
                            }, [h('span', params.row.xklclcd)]);
                        }
                    },
                    {
                        width:'10%',
                        title: '创建人',
                        key: 'createby',
                        render: (h, params) => {
                            return h('Tooltip', {
                                props: {
                                    content: params.row.createby,
                                    placement:"bottom-start"
                                }
                            }, [h('span', params.row.createby)]);
                        }
                    },
                    {
                        width:'10%',
                        title: '状态',
                        key: 'czlx',
                        render: (h, params) => {
                            const text = params.row.iscancel == "0" ? "已撤销" : params.row.czlx;
                            return h('Tooltip', {
                                props: {
                                    content: text,
                                    placement:"bottom-start"
                                }
                            }, [text == "已撤销" ? h('i',
                                {
                                    class:'iconfont icon-chexiao1',
                                    style:{
                                        'font-size':'20px',
                                        color: '#8a8a8a'
                                    }
                                }) : text == "换料" ? h('i',
                                {
                                    class:'iconfont icon-huanliao1',
                                    style:{
                                        'font-size':'20px',
                                        color: '#3399ff'
                                    }
                                }) : text == "停滞" ? h('i',
                                {
                                    class:'iconfont icon-tingzhi',
                                    style:{
                                        'font-size':'20px',
                                        color: '#f76162'
                                    }
                                }) : h('i',
                                {
                                    class:'iconfont icon-fanghang',
                                    style:{
                                        'font-size':'20px',
                                        color: '#36b3b3'
                                    }
                                })]);
                        }
                    },
                    {
                        width:'14%',
                        title: '操作日期',
                        key: 'czrq',
                        render: (h, params) => {
                            const text = new Date(params.row.czrq).format("yyyy-MM-dd hh:mm:ss");
                            return h('Tooltip', {
                                props: {
                                    content: text,
                                    placement:"bottom-start"
                                }
                            }, [h('span', text)]);
                        }
                    },
                    {
                        width:'14%',
                        title: '操作',
                        key: 'action',
                        render: (h, params) => {
                            return h('div', [
                                h('Button',
                                    {
                                        class:"error blue",
                                        on: {
                                            click: () => {
                                                this.checkDdtz(params.row.id)
                                            }
                                        }
                                    }, [
                                        h('i', {
                                            class : 'iconfont icon-chakan'
                                        }),
                                        h("span",'查看')
                                    ]),
                                params.row.iscancel!='0'&&params.row.czlx=="停滞"?h('Button',
                                    {
                                        class:"error red",
                                        on: {
                                            click: () => {
                                                this.removeddtz(params.row)
                                            }
                                        }
                                    }, [
                                        h('i', {
                                            class : 'iconfont icon-quxiao'
                                        }),
                                        h("span",'取消')
                                    ]):""
                            ]);
                        }
                    }
                ],
                //订单停滞数据
                ddtzData:[],
            }
        },
        created:function(){
            var width = window.innerWidth;
            if(width >1600){
                this.height=window.innerHeight-200;
            }else if(width > 1440 && width <=1600){
                this.height=window.innerHeight-180;
            }else if(width > 1366 && width <=1440){
                this.height=window.innerHeight-172;
            }else if(width > 1280 && width <=1366){
                this.height=window.innerHeight-166;
            }else if(width > 1024 && width <=1280){
                this.height=window.innerHeight-162;
            }else{
                this.height=window.innerHeight-151;
            }
            if(window.innerWidth>1600){
                this.pageSize=20;
            }
            this.CusFilesData = this.ddtzTableData(this.ddtzForm,this.currentPage,this.pageSize)
        },
        mounted() {
        },
        methods: {
            //查询物流数据，条件，当前页，每页显示多少条
            ddtzTableData (formData,currentPage,pageSize) {
                this.spinShow=true;
                this.tableShow = false;
                var khdh = formData.khdh;//订单号
                var czlx = formData.czlx;//操作类型
                var fromDate = '';//开始时间
                var toDate = '';//结束时间
                if(formData.creatDate.length != 0 && formData.creatDate[0] != null){
                    var fromDateTime = (new Date(formData.creatDate[0])).getTime();
                    fromDate = new Date(fromDateTime).format("yyyy-MM-dd");
                    var toDateTime = (new Date(formData.creatDate[1])).getTime();
                    toDate = new Date(toDateTime).format("yyyy-MM-dd");
                }
                let data = {
                    params: {
                        pageIndex : currentPage,
                        pageSize : pageSize,
                        khdh : khdh,
                        czlx : czlx,
                        fromDate : fromDate,
                        toDate : toDate
                    }
                };
                axios.get('/orderstop',data).then(res => {
                    this.total=res.data.total;
                    this.pageTotal=Math.ceil(res.data.total / pageSize);
                    this.ddtzData = res.data.data;
                    this.spinShow=false;
                    this.tableShow = true;
                }).catch(err =>{
                })
            },
            //发送
            sendPicOrder(name){
                this.modal_loading = true;
                this.$refs[name].validate((valid) => {
                    if (valid) {
                        axios.put('/orderstop/sdmsg', this.ddtzValidate).then(res => {
                            this.modal_loading = false;
                            this.ddtzcllxList=[];
                            this.ddtzclbmList=[];
                            this.ddtzModal=false;
                            this.isSend=false;
                            this.messageModal=false;
                            this.footer=false;
                            this.isTZ=true;
                            this.isTZHL=true;
                            this.isHL=false;
                            this.isFXHL=false;
                            this.isFX=false;
                            this.$Message.success('添加成功');
                            this.$refs[name].resetFields();
                            this.CusFilesData = this.ddtzTableData(this.ddtzForm,this.currentPage,this.pageSize);
                        }).catch(err =>{
                        });
                    } else {
                        this.modal_loading = false;
                    }
                });
            },
            //短消息
            addMessage(){
                this.messageModal = true;
                this.isSend = true;
            },
            //条件查询
            ddtzFormSearch(){
                this.currentPage=1;
                this.ddtzData = this.ddtzTableData(this.ddtzForm,this.currentPage,this.pageSize);
            },
            //改变页数
            changePage: function (page) {
                this.currentPage=page;
                this.ddtzData = this.ddtzTableData(this.ddtzForm,this.currentPage,this.pageSize);
            },
            //改变每页显示多少条
            changeSize: function (pageSize) {
                this.currentPage=1;
                this.pageSize = pageSize;
                this.pageTotal=Math.ceil(this.total / this.pageSize);
                this.ddtzData = this.ddtzTableData(this.ddtzForm,this.currentPage,this.pageSize);
            },
            //查看订单停滞详情
            checkDdtz(column) {
                axios.get('/orderstop/'+column).then(res => {
                    this.ddtzModal = true;//详情
                    this.ddtzDetail = res.data;
                    this.ddtzDetail.czrq=new Date(this.ddtzDetail.czrq).format("yyyy-MM-dd hh:mm:ss");
                }).catch(err =>{
                });
            },
            //根据ID取消订单
            removeddtz(row) {
                this.delModal=true;
                this.delId = row.id;
            },
            delOK(){
                this.delLoading = true;
                axios.put('/orderstop/'+this.delId).then(res => {
                    this.delLoading = false;
                    this.delModal=false;
                    this.$Message.success('取消停滞成功');
                    this.ddtzData = this.ddtzTableData(this.ddtzForm,this.currentPage,this.pageSize);
                }).catch(err =>{
                    this.$Message.error({content: err,duration: 0,closable:true});
                });
            },
            delCancel() {
                this.delModal=false;
                this.delId = '';
            },
            cancel(){
                this.ddtzDetail={
                    clbm:"",
                    cllx:"",
                    cnbltype:"",
                    columns:"",
                    createby:"",
                    czlx:"",
                    czrq:"",
                    dklclcd:"",
                    id:"",
                    ip:"",
                    iscancel:"",
                    isproduce:"",
                    khdh:"",
                    orderby:"",
                    resultcode:"",
                    syscode:"",
                    tranmeomo:"",
                    username:"",
                    xklclcd:""
                }
            },
            //清空数据
            clearPicOrder (name) {
                this.$refs[name].resetFields();
                this.ddtzcllxList=[];
                this.ddtzclbmList=[];
                this.messageModal=false;
                this.isTZ=true;
                this.isTZHL=true;
                this.isHL=false;
                this.isFXHL=false;
                this.isFX=false;
            },
            //选择类型
            changeczlx(value){
                if(value == 1){//停滞
                    this.isTZ = true;
                    this.isTZHL = true;
                    this.isHL = false;
                    this.isFXHL = false;
                    this.isFX = false;
                    this.ddtzValidate.clbm = this.ddtzValidate.cllx;
                }else if(value == 2){//放行
                    this.isTZ = false;
                    this.isTZHL = false;
                    this.isHL = false;
                    this.isFXHL = true;
                    this.isFX = true;
                }else if(value == 3){//换料
                    this.ddtzValidate.clbm = "";
                    this.isTZ = false;
                    this.isTZHL = true;
                    this.isHL = true;
                    this.isFXHL = true;
                    this.isFX = false;
                }
            },
            //自动补全订单号
            remoteOrderno(query){
                if (query !== '') {
                    this.loadingOrderno = true;
                    axios.get('/orderstop/'+query+"/auto").then(res => {
                        this.loadingOrderno = false;
                        this.autoList  = res.data;
                        this.ddtzValidate.jhrq = res.data[0].jhrq;
                        this.ddtzValidate.chpjq = res.data[0].chpjq;
                        this.ddtzValidate.cjjq = res.data[0].cjjq;
                        this.ddtzValidate.fzhjq = res.data[0].fzhjq;
                        this.ddtzValidate.zhtjq = res.data[0].zhtjq;
                        this.ddtzValidate.bzhjq = res.data[0].bzhjq;
                        this.ddtzValidate.scddid = res.data[0].scddid;
                    }).catch(err =>{
                    })
                } else {
                    this.autoList  = [];
                }
            },
            clearSingleSelect(){
                this.$refs.Select.clearSingleSelect()
            },
            changeOrder(selection) {
                if(selection != ""){
                    this.ddtzcllxList=[];
                    this.ddtzclbmList=[];
                    axios.get('/orderstop/'+selection+'/cad').then(res => {
                        this.ddtzValidate.syscode = res.data[0].ecode;
                        this.ddtzcllxList.push({cYlbwflEcode:"",cYlbwflEname:"请选择"});
                        this.ddtzclbmList.push({cYlbwflEcode:"",tDdpbylmxYlbm:"请选择"});
                        for(var i = 0; i<res.data.length;i++){
                            this.ddtzcllxList.push(res.data[i]);
                            this.ddtzclbmList.push(res.data[i]);
                        }
                    }).catch(err =>{
                    })
                }
            },
            changeCllx(selection){
                if(!this.isHL)this.ddtzValidate.clbm = selection;
            }
        }
    }
</script>
